import request from '/@/utils/request';
// 查询分类管理列表
export function listLkCategory(query:Object) {
    return request({
        url: '/system/lkCategory/list',
        method: 'get',
        params: query
    })
}
// 查询分类管理详细
export function getLkCategory(categoryID:Object) {
    return request({
        url: '/system/lkCategory/get',
        method: 'get',
        params: {
            id: categoryID.toString()
        }
    })
}
// 新增分类管理
export function addLkCategory(data:Object) {
    return request({
        url: '/system/lkCategory/add',
        method: 'post',
        data: data
    })
}
// 修改分类管理
export function updateLkCategory(data:Object) {
    return request({
        url: '/system/lkCategory/edit',
        method: 'put',
        data: data
    })
}
// 删除分类管理
export function delLkCategory(categoryIDs:Object) {
    return request({
        url: '/system/lkCategory/delete',
        method: 'delete',
        data:{
            ids:categoryIDs
        }
    })
}

// 查询菜单列表
export function listCateMenu(query:Object) {
    return request({
        url: '/templates/cate',
        method: 'get',
        params: query
    })
}

// 查询菜单详细
export function getCategory(menuId:Object) {
    return request({
        url: '/system/menu/get?id=' + menuId,
        method: 'get'
    })
}

// 查询菜单下拉树结构
export function treeselect() {
    return request({
        url: '/system/lkCategory/menutree',
        method: 'get'
    })
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId:Object) {
    return request({
        url: '/system/menu/roleMenuTreeselect/' + roleId,
        method: 'get'
    })
}

// 新增菜单
export function addMenu(data:Object) {
    return request({
        url: '/system/menu/add',
        method: 'post',
        data: data
    })
}

// 修改菜单
export function updateMenu(data:Object) {
    return request({
        url: 'system/menu/update',
        method: 'put',
        data: data
    })
}

// 删除菜单
export function delMenu(menuId:Object) {
    return request({
        url: '/system/menu/delete',
        method: 'delete',
        data:{ids:[menuId]}
    })
}

// 查询分类模型选项
export function getModelOptions(module:Object) {
    return request({
        url: '/system/auth/modelOptions',
        method: 'get',
        params:{module:module}
    })
}
// 根据字典类型查询字典数据信息
export function getDicts(dictType:any,defaultValue:any) {
    defaultValue = defaultValue || ''
    let params ={
        dictType:dictType,
        defaultValue:defaultValue
    }
    return request({
        url: '/system/dict/data/getDictData',
        method: 'get',
        params:params
    })
}